import { UserData } from '@/api/user/user.d';

const USER_KEY = 'userInfo';

const getUserInfo = () => {
  return localStorage.getItem(USER_KEY);
};

const setUserInfo = (userinfo: UserData) => {
  localStorage.setItem(USER_KEY, JSON.stringify(userinfo));
};

const clearUserInfo = () => {
  localStorage.removeItem(USER_KEY);
};

export { getUserInfo, setUserInfo, clearUserInfo };
